#include<iostream>

using namespace std;

int gcd(int a, int b){
	return b?gcd(b,a%b):a;
}

int main(){
	int x, y, result;
	cin>>x>>y;
	int g = gcd(x, y);
    
    if(g&(g-1)==0){
    	cout<<"true";
	}else{
		cout<<"false";
	}
    return 0;
} 

